using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace TradingLab.Data
{
    [Serializable]
    public class PropertyBoxData:Dictionary<string,PropertyData>
    {
        public PropertyBoxData()
        {
        }

        public PropertyBoxData(SerializationInfo info, StreamingContext context) : base(info, context)
        {
        }

        public void MergeWith(PropertyBoxData propertyBoxData)
        {
            foreach (KeyValuePair<string, PropertyData> propertyName_PropertyData in propertyBoxData)
            {
                if (!ContainsKey(propertyName_PropertyData.Key))
                {
                    Add(propertyName_PropertyData.Key, propertyName_PropertyData.Value);
                }
                else
                {
                    this[propertyName_PropertyData.Key] = propertyName_PropertyData.Value;
                }
            }
        }
    }
}